package com.company.nuwa.common.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * <p>消息通道定义</p >
 *
 * @author Mitchell
 * @version 1.0
 * @date 2020/11/9 20:20
 */
@AllArgsConstructor
public enum MessageChannelDef {

    /**
     * null
     */
    NULL("NULL", "", "", ""),


    /**
     * ims 聊天消息
     */
    IMS_HTTP_IM_MSG_MQ("IMS_HTTP_IM_MSG_MQ", Topic.NUWA_GENERAL_TOPIC, Tag.IMS_HTTP_IM_MSG_MQ_TAG, Group.IMS_HTTP_IM_MSG_MQ_GROUP),

    /**
     * ims 通知
     */
    IMS_HTTP_PUSH_MSG_MQ("IMS_HTTP_PUSH_MSG_MQ", Topic.NUWA_GENERAL_TOPIC, Tag.IMS_HTTP_PUSH_MSG_MQ_TAG, Group.IMS_HTTP_PUSH_MSG_MQ_GROUP),

    /**
     * hook事件
     */
    IMS_WEB_HOOK_MSG_MQ("IMS_WEB_HOOK_MSG_MQ", Topic.NUWA_GENERAL_TOPIC, Tag.IMS_WEB_HOOK_MSG_MQ_TAG, Group.IMS_WEB_HOOK_MSG_MQ_GROUP),



    TSF_MQ("TSF_MQ", Topic.NUWA_TSF_TOPIC, Tag.TSF_TAG, Group.TSF_MQ_GROUP),


    ;

    @Getter
    private final String code;

    @Getter
    private final  String topic;

    @Getter
    private final  String tag;

    @Getter
    private final  String group;

    /**
     * topic
     * <p>
     * ALI TOPIC 很贵，新建topic需要谨慎考虑，尽量用通用topic
     */
    public   interface Topic {

        /**
         * 通用 topic(ALI TOPIC 很贵，新建topic需要谨慎考虑，尽量用通用topic)
         */
        String NUWA_GENERAL_TOPIC = "NUWA_GENERAL_TOPIC";

        String NUWA_TSF_TOPIC = "NUWA_TSF_TOPIC";

    }

    /**
     * tag
     */
    public interface Tag {

        /**
         * ims 聊天消息 TAG
         */
        String IMS_HTTP_IM_MSG_MQ_TAG = "IMS_HTTP_IM_MSG_MQ_TAG";

        /**
         * ims 通知 TAG
         */
        String IMS_HTTP_PUSH_MSG_MQ_TAG = "IMS_HTTP_PUSH_MSG_MQ_TAG";

        /**
         * hook 事件 TAG
         */
        String IMS_WEB_HOOK_MSG_MQ_TAG = "IMS_WEB_HOOK_MSG_MQ_TAG";


        /**
         * ims 聊天消息 TAG
         */
        String TSF_TAG = "TSF_TAG";

    }

    /**
     * 消费组 group
     */
    public interface Group {

        /**
         * 前缀
         */
        String PREFIX = "GID_NUWA_";

        /**
         * ims 聊天消息 Group
         */
        String IMS_HTTP_IM_MSG_MQ_GROUP = PREFIX + Topic.NUWA_GENERAL_TOPIC + "_" + Tag.IMS_HTTP_IM_MSG_MQ_TAG;

        /**
         * ims 通知 Group
         */
        String IMS_HTTP_PUSH_MSG_MQ_GROUP = PREFIX + Topic.NUWA_GENERAL_TOPIC + "_" + Tag.IMS_HTTP_PUSH_MSG_MQ_TAG;

        /**
         * hook 事件 Group
         */
        String IMS_WEB_HOOK_MSG_MQ_GROUP = PREFIX + Topic.NUWA_GENERAL_TOPIC + "_" + Tag.IMS_WEB_HOOK_MSG_MQ_TAG;


        /**
         * hook 事件 Group
         */
        String TSF_MQ_GROUP = PREFIX + Topic.NUWA_TSF_TOPIC + "_" + Tag.TSF_TAG;


    }


}
